<template>
    <div>
        <p>{{ title }}</p>
        <p v-for="item in user" :key="item">{{ item }}</p>
        <p>{{ msg }}</p>
        <button @click="$emit('sonEmit',1,'string',{name:'小强'})">emit触发父组件绑定子组件上的函数</button>
    </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
export interface Iuser{
    id?:number
    name:string
    age:number
    sex:string
}
const {title=ref('江山如此多娇'),user,msg}=defineProps<{
    title?:string,
    user:Iuser,
    msg?:string
}>()
console.log(title,user,msg);
</script>